home *** CD-ROM | disk | FTP | other *** search
/ 600 Games / 600games.iso / Nave / spaceambush.swf / scripts / frame_286 / PlaceObject2_451_82 / CLIPACTIONRECORD onClipEvent(enterFrame).as next >
Encoding:
Text File  |  2007-03-12  |  814 b   |  40 lines

  1. onClipEvent(enterFrame){
  2.    if(7200 < _root.sco)
  3.    {
  4.       if(st == 1)
  5.       {
  6.          att = true;
  7.          st = 0;
  8.       }
  9.    }
  10.    if(_root.amitavaplay == false)
  11.    {
  12.       att = false;
  13.    }
  14.    if(att == true)
  15.    {
  16.       dx = _X - _root.tank._x;
  17.       dy = _Y - _root.tank._y;
  18.       d = Math.sqrt(dx * dx + dy * dy);
  19.       if(50 < d)
  20.       {
  21.          rad = Math.atan2(dy,dx) + 3.141592653589793;
  22.          deg = rad * 180 / 3.141592653589793;
  23.          _rotation = deg;
  24.          b = 3 * Math.cos(rad);
  25.          p = 3 * Math.sin(rad);
  26.          _X = _X + b;
  27.          _Y = _Y + p;
  28.       }
  29.       else if(0 < _root.amithealth)
  30.       {
  31.          _alpha = _alpha - 1;
  32.          if(_alpha < 1)
  33.          {
  34.             att = false;
  35.             this.x = -3000;
  36.          }
  37.       }
  38.    }
  39. }
  40.